package com.baitai.system.service.impl;

import java.util.List;

import com.baitai.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baitai.system.mapper.SysUserZcyxMapper;
import com.baitai.system.domain.SysUserZcyx;
import com.baitai.system.service.ISysUserZcyxService;

/**
 * zcyx备用用户
 * Service业务层处理
 *
 * @author xx
 * @date 2024-12-01
 */
@Service
public class SysUserZcyxServiceImpl implements ISysUserZcyxService {
    @Autowired
    private SysUserZcyxMapper sysUserZcyxMapper;

    /**
     * 查询zcyx备用用户
     *
     * @param id zcyx备用用户
     *           主键
     * @return zcyx备用用户
     */
    @Override
    public SysUserZcyx selectSysUserZcyxById(Long id) {
        return sysUserZcyxMapper.selectSysUserZcyxById(id);
    }

    /**
     * 查询zcyx备用用户
     *
     * @param userId zcyx备用用户
     *           主键
     * @return zcyx备用用户
     */
    @Override
    public SysUserZcyx selectSysUserZcyxByUserId(Long userId){
        return sysUserZcyxMapper.selectSysUserZcyxByUserId(userId);
    }

    /**
     * 查询zcyx备用用户
     * 列表
     *
     * @param sysUserZcyx zcyx备用用户
     * @return zcyx备用用户
     */
    @Override
    public List<SysUserZcyx> selectSysUserZcyxList(SysUserZcyx sysUserZcyx) {
        return sysUserZcyxMapper.selectSysUserZcyxList(sysUserZcyx);
    }

    /**
     * 新增zcyx备用用户
     *
     * @param sysUserZcyx zcyx备用用户
     * @return 结果
     */
    @Override
    public int insertSysUserZcyx(SysUserZcyx sysUserZcyx) {
        sysUserZcyx.setUpdataTime(DateUtils.getNowDate());
        return sysUserZcyxMapper.insertSysUserZcyx(sysUserZcyx);
    }

    /**
     * 修改zcyx备用用户
     *
     * @param sysUserZcyx zcyx备用用户
     * @return 结果
     */
    @Override
    public int updateSysUserZcyx(SysUserZcyx sysUserZcyx) {
        return sysUserZcyxMapper.updateSysUserZcyx(sysUserZcyx);
    }

    /**
     * 批量删除zcyx备用用户
     *
     * @param ids 需要删除的zcyx备用用户
     *            主键
     * @return 结果
     */
    @Override
    public int deleteSysUserZcyxByIds(Long[] ids) {
        return sysUserZcyxMapper.deleteSysUserZcyxByIds(ids);
    }

    /**
     * 删除zcyx备用用户
     * 信息
     *
     * @param id zcyx备用用户
     *           主键
     * @return 结果
     */
    @Override
    public int deleteSysUserZcyxById(Long id) {
        return sysUserZcyxMapper.deleteSysUserZcyxById(id);
    }
}
